<?php

/**
 * Core_Model_Ormbuilder
 *
 * @author Adrian Stolarski
 */
class Core_Model_Ormbuilder implements Core_Model_Ormable {
    
    public $action_handler;
   
    public function main(array $variables = null, $table = null, $action = null, $where = '1') {
        switch($action){
            case "select":
                return $this->select($variables, $table, $where);
                break;
            case "insert":
                return $this->select($variables, $table, $where);
                break;
            case "update":
                return $this->update($variables, $table, $where);
                break;
            /**case "delete":
                return $this->delete($variables, $table, $where);
                break;**/
            default:
                $this->select($variables, $table, $where);
                break;
        }
    }
    
    private function select(array $variables = null, $table = null, $where = '1'){
        
    }
    
    private function insert(array $variables = null, $table = null, $where = '1'){
        $this->action_handler = new Core_Model_Insertmodel;
        return $this->action_handler->main($variables, $table, $action = null, $where);
    }
    
    private function update(array $variables = null, $table = null, $where = '1'){
        $this->action_handler = new Core_Model_Updatemodel;
        return $this->action_handler->main($variables, $table, $action, $where);
    }
    
    /**private function delete(array $variables = null, $table = null, $where = '1'){
        
    }**/
    
    

}
